package com.bzg.baseSpringComponent.messagesource;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ResourceBundleMessageSource;

@Configuration
public class Config {

	@Bean("messageSource")
	public ResourceBundleMessageSource register() {
		ResourceBundleMessageSource resourceBundleMessageSource = new ResourceBundleMessageSource();
		resourceBundleMessageSource.setBasename("messages"); // 设置文件读取前缀
		return resourceBundleMessageSource;
	}
}
